package main

import (
	"fmt"
	"strconv"
)

//字符串转换
func main() {

	str := make([]byte, 0, 100)
	str = strconv.AppendInt(str, 4567, 10) //以10进制方式追加

	fmt.Println(string(str))

	str = strconv.AppendBool(str, false)

	fmt.Println(string(str))

	str = strconv.AppendQuote(str, "abcdefg")

	fmt.Println(string(str))

	//其他类型转换

	formatBool := strconv.FormatBool(true)

	fmt.Println("formatBool = " ,formatBool)

	formatInt := strconv.FormatInt(100, 10)

	fmt.Println("formatInt = " + formatInt)

	float := strconv.FormatFloat(3.1415926, 'f', -1, 64)

	fmt.Println("float = ",float)

	itoa := strconv.Itoa(666)

	fmt.Println("itoa = ",itoa)

	b, e := strconv.ParseBool("true")

	fmt.Println(b,e)
}
